package com.guli.mall.pms.config;

//import com.aliyun.oss.OSS;
//import com.aliyun.oss.OSSClient;
//import com.aliyun.oss.OSSClientBuilder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/*
 * @Author 罗
 * @date 2020/9/18 - 8:31 下午
 */
@EnableConfigurationProperties(MyAliOssProperties.class)
@Slf4j
//@Configuration
public class MyAliOssConfig {

    /**
     * 这样放入IOC容器的Oss对象也可以用，但是用的时候不可以关闭Oss
     * */
/*    @Bean
    public OSS oss(MyAliOssProperties myAliOssProperties){
        OSS oss = new OSSClientBuilder().build(
                myAliOssProperties.getEndpoint(),
                myAliOssProperties.getAccessKey(),
                myAliOssProperties.getSecretKey());

        log.info("阿里云Oss对象创建完成");
        return oss;
    }*/

}
